<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('教师评阅')"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-edit" th:object="${workly}">
        <input id="worklyId" name="worklyId" th:field="*{worklyId}" type="hidden"/>
        <input id="worklyCategory" name="worklyCategory" th:field="*{worklyCategory}" type="hidden"/>
        <input id="stuProdId" name="stuProdId" th:field="*{stuWorkId}" type="hidden"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">作业内容：</label>
            <div class="col-sm-8">
					<textarea class="form-control" id="worklyMain" name="worklyMain" readonly
                              style="margin: 0px 12px 0px 0px; width: 461px; height: 344px;"
                              th:field="*{worklyMain}" type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">分数：</label>
            <div class="col-sm-8">
                <input class="form-control" id="worklyScore" name="worklyScore" readonly th:field="*{worklyScore}"
                       type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">实际得分：</label>
            <div class="col-sm-8">
                <input class="form-control" id="worklyActScore" name="worklyActScore" th:field="*{worklyActScore}"
                       type="text"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">教师评语：</label>
            <div class="col-sm-8">
					<textarea class="form-control" id="worklyRemark" name="worklyRemark" style="margin: 0px 12px 0px 0px; width: 461px; height: 144px;"
                              th:field="*{worklyRemark}"
                              type="text"/>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    $(function () {

    });

    function edit() {
        var worklyId = $("input[name='worklyId']").val();
        var worklyScore = $("input[name='worklyScore']").val();
        var worklyActScore = $("input[name='worklyActScore']").val();
        var worklyRemark = $("textarea[name='worklyRemark']").val();
        var worklyCategory = $("input[name='worklyCategory']").val();
        var stuWorkId = $("input[name='stuWorkId']").val();
        $.ajax({
            cache: true,
            type: "POST",
            url: ctx + "sau/workteaaudit/updateWeeklyByTea",
            data: {
                "worklyId": worklyId,
                "worklyScore": worklyScore,
                "worklyActScore": worklyActScore,
                "worklyRemark": worklyRemark,
                "worklyCategory": worklyCategory,
                "stuWorkId": stuWorkId
            },
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.successCallback(data);
            }
        });
    }

    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }
</script>
</body>
</html>
